<!DOCTYPE HTML>
<html>

	<head>
		<script type="text/javascript">
			function allowDrop(ev) {
				ev.preventDefault();
			}

			function drag(ev) {
				ev.dataTransfer.setData("Text", ev.target.id);
			}

			function drop(ev) {
				ev.preventDefault();
				var data = ev.dataTransfer.getData("Text");
				ev.target.appendChild(document.getElementById(data));
			}
		</script>
		
	</head>
	<style>
		#div1{
			width:200px;
			height:300px;
			border:1px solid red;
		}
	</style>
	<body>

		<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
		<img id="drag1" src="log.png" draggable="true" ondragstart="drag(event)"/>

	</body>

</html>